package com.mind.battle;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import com.mind.login.model.Player;

public class BattleManager {
	private Map<Short, Room> rooms=new HashMap<Short, Room>();
	private static BattleManager manager=new BattleManager();
	public static BattleManager getInstance(){
		return manager;
	}
	public void enterRoom(Player player,int roomId){
		Room room;
		if(!rooms.containsKey(roomId)){
			room=new Room((short)new Random().nextInt());
		}else{
			room=rooms.get(roomId);
		}
		room.enterRoom(player);
	}
	
	
}
